home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / CLISRV / BOOKSALE / SERVER / MODEL.CLS < prev    next >
Encoding:
Text File  |  1996-09-20  |  937 b   |  38 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Model"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Function intGetMonthSales(intCurMonth As Integer, intSalesPeriod As Integer, intModelType As Integer) As Integer
  11.   Dim intMonthSales As Integer
  12.   Const intMAX_SCHOOL_BOOK = 2
  13.   Const intMAX_POP_NOVEL = 7
  14.   Const intMAX_CELEBRITY = 8
  15.     
  16.   Select Case intModelType
  17.     Case gintSCHOOL_BOOK_MODEL
  18.         intMonthSales = intMAX_SCHOOL_BOOK
  19.         
  20.     Case gintPOP_NOVEL_MODEL
  21.         intMonthSales = -((intCurMonth - intSalesPeriod / 2) ^ 2 - intMAX_POP_NOVEL)
  22.         
  23.     Case gintCELEBRITY_BIOGRAPHY_MODEL
  24.         intMonthSales = -((intCurMonth - intSalesPeriod / 4) ^ 2 - intMAX_CELEBRITY)
  25.   
  26.   End Select
  27.  
  28.   If intMonthSales < 0 Then
  29.     intGetMonthSales = 0
  30.     
  31.   Else
  32.     intGetMonthSales = intMonthSales
  33.     
  34.   End If
  35.   
  36. End Function
  37.  
  38.